﻿/**********************************天使物流*******************************************
* 功能描述:合同管理-通用合同
* 作者:石锦涛
* 时间:2022-01-08
* 
**********************************天使物流*******************************************/
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using TianShiProject.Models.Common;
using TianShiProject.Models.Contract.NewGeneralContras;
using Volo.Abp.Application.Services;

namespace TianShiProject.Contract.NewGeneralContras
{
    public class NewGenerApp:ApplicationService
    {
        private readonly INewGenerAppRepository _newGenerAppRepository;
        public NewGenerApp(INewGenerAppRepository newGenerAppRepository)
        {
            _newGenerAppRepository = newGenerAppRepository;
        }

        /// <summary>
        /// 通用合同显示
        /// </summary>
        /// <returns></returns>
        public async Task<PageResponse<NewGeneralContraDto>> GetResponse(string telet, string danwei, string principal, string operators, string dtime, int? state, int pageindex = 1, int pagesize = 5)
        {

            try
            {
                return await _newGenerAppRepository.GetResponse(telet, danwei, principal, operators, dtime, state, pageindex, pagesize);
            }
            catch (Exception)
            {

                throw;
            }
        }

        /// <summary>
        /// 通用逻辑删除
        /// </summary>
        /// <param name="Id"></param>
        /// <returns></returns>
        public async Task<PageResponse<NewGeneralContraDto>> DeleteGeneral(int Id)
        {
            try
            {
                return await  _newGenerAppRepository.DeleteGeneral(Id);
            }
            catch (Exception)
            {

                throw;
            }
        }
        /// <summary>
        /// 通用修改
        /// </summary>
        /// <param name="contraDto"></param>
        /// <returns></returns>
        public async Task<PageResponse<int>> UpdateGeneral(NewGeneralContraDto contraDto)
        {
            try
            {
                return await _newGenerAppRepository.UpdateGeneral(contraDto);
            }
            catch (Exception)
            {

                throw;
            }
        }
        /// <summary>
        /// 通用添加
        /// </summary>
        /// <param name="contraDto"></param>
        /// <returns></returns>
        public async Task<PageResponse<int>> PostGeneral(NewGeneralContraDto contraDto)
        {
            try
            {
                return await _newGenerAppRepository.PostGeneral(contraDto);
            }
            catch (Exception)
            {

                throw;
            }
        }

        /// <summary>
        /// 通用批量删除
        /// </summary>
        /// <param name="Id"></param>
        /// <returns></returns>
        public async Task<PageResponse<NewGeneralContraDto>> DeletEmoreGeneral(string Id)
        {
            try
            {
                return await _newGenerAppRepository.DeletEmoreGeneral(Id);
            }
            catch (Exception)
            {

                throw;
            }
        }

    }
}
